

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_scap_Schedule_DateCreated]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[scap_Schedules] DROP CONSTRAINT [DF_scap_Schedule_DateCreated]
END

GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[DF_scap_Schedule_DateModified]') AND type = 'D')
BEGIN
ALTER TABLE [dbo].[scap_Schedules] DROP CONSTRAINT [DF_scap_Schedule_DateModified]
END

GO


/****** Object:  Table [dbo].[scap_Schedules]    Script Date: 03/03/2013 23:37:10 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[scap_Schedules]') AND type in (N'U'))
DROP TABLE [dbo].[scap_Schedules]
GO


CREATE TABLE [dbo].[scap_Schedules](
	[Id] [int] NOT NULL,
	[Name] [nvarchar](200) NOT NULL,
	[Enabled] [bit] NOT NULL,
	[FrequencyType] [int] NOT NULL,
	[FrequencyInterval] [int] NOT NULL,
	[FrequencySubdayType] [int] NOT NULL,
	[FrequencySubdayInterval] [int] NOT NULL,
	[FrequencyRelativeInterval] [int] NOT NULL,
	[FrequencyRecurrenceFactor] [int] NOT NULL,
	[ActiveStartDate] [date] NOT NULL,
	[ActiveEndDate] [date] NOT NULL,
	[DateCreated] [date] NOT NULL,
	[DateModified] [date] NOT NULL
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[scap_Schedules] ADD  CONSTRAINT [DF_scap_Schedule_DateCreated]  DEFAULT (getdate()) FOR [DateCreated]
GO

ALTER TABLE [dbo].[scap_Schedules] ADD  CONSTRAINT [DF_scap_Schedule_DateModified]  DEFAULT (getdate()) FOR [DateModified]
GO


